]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
pointerA11yTimeout: Protect against destroyed PieTimer actor
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 12 Sep 2025 13:28:09 +0000 (15:28 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 12 Sep 2025 14:35:17 +0000 (14:35 +0000)
This trigger an exception if the PieTimer destroys itself before the
ClutterSeat::ptr-a11y-timeout-stopped signal triggers. It's unlikely
to happen now with the fixed arguments, but still makes sense for
correctness.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3877>

js/ui/pointerA11yTimeout.js

index 6a9ceca662f22e982b373482c8bca436ae307787..a3af452f00a8abeff29f6080f974a888247fad8d 100644 (file)
@@ -118,6 +118,7 @@ export class PointerA11yTimeout {
             this._pieTimer = new PieTimer();
             Main.uiGroup.add_child(this._pieTimer);
             Main.uiGroup.set_child_above_sibling(this._pieTimer, null);
+            this._pieTimer.connect('destroy', () => (this._pieTimer = null));
 
             this._pieTimer.start(x, y, timeout);
 
@@ -127,7 +128,7 @@ export class PointerA11yTimeout {
 
         seat.connect('ptr-a11y-timeout-stopped', (o, type, clicked) => {
             if (!clicked)
-                this._pieTimer.destroy();
+                this._pieTimer?.destroy();
 
             if (type === Clutter.PointerA11yTimeoutType.GESTURE)
                 global.display.set_cursor(Meta.Cursor.DEFAULT);